Previous Book Contents Book Index Next

Inside Macintosh: Programming With the Text Encoding Conversion Manager /
Chapter 4 - Unicode Converter Reference / Unicode Converter Functions
Converting From Unicode /


CreateUnicodeToTextInfo

Creates and returns a Unicode converter object containing information required for converting strings from Unicode to a non-Unicode encoding.

pascal OSStatus CreateUnicodeToTextInfo (
      ConstUnicodeMappingPtr iUnicodeMapping, 
      UnicodeToTextInfo *oUnicodeToTextInfo);
iUnicodeMapping
A pointer to a structure of type UnicodeMapping (page 118). Your application provides this structure to identify the mapping to be used for the conversion. The unicodeEncoding field of this structure can specify a Unicode format of kUnicode16BitFormat or kUnicodeUTF8Format. Note that the versions of the Unicode Converter prior to 1.2.1 do not support kUnicodeUTF8Format.
oUnicodeToTextInfo
A pointer to a Unicode converter object of type UnicodeToTextInfo (page 120), used for converting Unicode strings to text. On output, the parameter returns a Unicode converter object that holds the mapping table information you supply as the iUnicodeMapping parameter and the state information related to the conversion. The information contained in the Unicode converter object is required for the conversion of a Unicode string to a non-Unicode encoding.
function result
A result code. See "Text Encoding Conversion Manager Result Codes" (page 42) in the chapter "Basic Text Types Reference."
DISCUSSION
You pass the Unicode converter object returned from CreateUnicodeToTextInfo to the function ConvertFromUnicodeToText (page 139) or ConvertFromUnicodeToPString (page 165) to identify the information to be used for the conversion. These two functions modify the contents of the Unicode converter object.

In addition to various resource and memory errors, the function can return the following result codes:

If an error is returned, the Unicode converter object is invalid.

SEE ALSO
The function CreateUnicodeToTextInfoByEncoding (page 136)


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1997